import {
    createRouter,
    createWebHistory
} from "vue-router";
import Home from '../views/Home.vue'
import About from '../views/About.vue'
import User from '../views/User.vue'


const router = createRouter({
    history: createWebHistory(),
    routes: [{
            path: "/",
            redirect: "/home",
            name: "/",
        },
        {
            path: "/home",
            component: Home,
            name: "home",
        },
        {
            path: "/about",
            component: About,
            name: "about"
        },
        {
            path: '/login',
            component:()=>import('../views/login.vue')
        },
        {
            path: "/user/:id",
            component: User,
            name: "user"
        },
        {
            path: "/:pathMatch(.*)",
            component: () => import("../views/NotFound.vue"),
        }
    ]
})

export default router;